if (symbol == Clutter.KEY_Escape ||
symbol == Clutter.KEY_Return ||
symbol == Clutter.KEY_KP_Enter) {
- this._ensureUnlockDialog(true);
+ this._ensureUnlockDialog(true, true);
this._hideLockScreen(true, 0);
return true;
}
// 7 standard scrolls to lift up
if (this._lockScreenScrollCounter > 35) {
- this._ensureUnlockDialog(false);
+ this._ensureUnlockDialog(false, true);
this._hideLockScreen(true, 0);
}
_onDragBegin: function() {
Tweener.removeTweens(this._lockScreenGroup);
this._lockScreenState = MessageTray.State.HIDING;
- this._ensureUnlockDialog(false);
+ this._ensureUnlockDialog(false, false);
return true;
},
// Complete motion automatically
let [velocity, velocityX, velocityY] = this._dragAction.get_velocity(0);
this._hideLockScreen(true, -velocityY);
+ this._ensureUnlockDialog(false, true);
} else {
// restore the lock screen to its original place
// try to use the same speed as the normal animation
this.actor.show();
this._isGreeter = Main.sessionMode.isGreeter;
- this._ensureUnlockDialog(true);
+ this._ensureUnlockDialog(true, true);
this._hideLockScreen(false, 0);
},
Main.sessionMode.popMode('lock-screen');
},
- _ensureUnlockDialog: function(onPrimary) {
+ _ensureUnlockDialog: function(onPrimary, allowCancel) {
if (!this._dialog) {
let constructor = Main.sessionMode.unlockDialog;
if (!constructor) {
this._dialog.connect('failed', Lang.bind(this, this._onUnlockFailed));
this._dialog.connect('unlocked', Lang.bind(this, this._onUnlockSucceded));
}
+
+ this._dialog.allowCancel = allowCancel;
},
_onUnlockFailed: function() {
this._workSpinner.actor.opacity = 0;
this._workSpinner.actor.show();
+ this.allowCancel = false;
this.buttonLayout.visible = true;
this.addButton({ label: _("Cancel"),
action: Lang.bind(this, this._escape),
},
_escape: function() {
- this._userVerifier.cancel();
- this.emit('failed');
+ if (this.allowCancel) {
+ this._userVerifier.cancel();
+ this.emit('failed');
+ }
},
_otherUserClicked: function(button, event) {